package com.cxk.hr.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cxk.hr.dao.PositionMapper;
import com.cxk.hr.pojo.Position;
import com.cxk.hr.service.PositionService;

@Service("positionService")
public class PositionServiceImpl implements PositionService {
	@Resource
	private PositionMapper positionMapper;

	@Override
	public Position selectByNumber(Integer positionNumber) {
		Position positoin = positionMapper.selectByNumber(positionNumber);
		return positoin;
	}

	@Override
	public List<Position> selectListByPage(Integer pageNo, Integer pageSize) {
		List<Position> positions = positionMapper.selectListByPage(pageNo, pageSize);
		return positions;
	}

	@Override
	public List<Position> selectList() {
		List<Position> positions = positionMapper.selectList();
		return positions;
	}

	public PositionMapper getPositionMapper() {
		return positionMapper;
	}

	public void setPositionMapper(PositionMapper positionMapper) {
		this.positionMapper = positionMapper;
	}

	public Integer findCountPosition() {
		Integer count = positionMapper.findCountPosition();
		return count;
	}

	public List<Position> findPositionByLimit(Integer currentPageNo, Integer pageSize) {
		List<Position> list = positionMapper.findPositionByLimit(currentPageNo, pageSize);
		return list;
	}

	public Integer addPosition(Position position) {
		Integer count = positionMapper.savePosition(position);
		return count;
	}

	public Position findPositionById(Integer id) {
		Position position = positionMapper.findPositionById(id);
		return position;
	}

	public Integer updatePosition(Position position) {
		Integer count = positionMapper.updatePosition(position);
		return count;
	}

	public Integer deletePosition(Integer id) {
		Integer count = positionMapper.deletePosition(id);
		return count;
	}

}
